/**
 * Project Name:PayTrade.java
 * File Name:PayTrade.java
 * Date:2018/7/31 上午10:47
 * Copyright (c) 2018, zhang.xiangyu@foxmail.com All Rights Reserved.
*/
package com.meatball.base.pay.trade.model;

import com.meatball.utils.DateUtil;
import com.meatball.vo.Pagetag;
import lombok.Data;

import java.util.Date;

/**
 * @Title: PayTrade.java
 * @Description: todo(交易记录)
 * @Author 張翔宇
 * @Date 2018/7/31 上午10:47
 * @Version V1.0
 */
@Data
public class PayTrade extends Pagetag {
    /**
     * 主键
     */
    private Long id;

    /**
     * 交易流水号
     */
    private String tradeNo;

    /**
     * 商户订单号
     */
    private String outTradeNo;

    /**
     * 买家支付宝用户号
     */
    private String buyerId;

    /**
     * 买家支付宝账号
     */
    private String buyerLogonId;

    /**
     * 订单金额
     */
    private Integer totalAmount;
    private Double totalAmountVo;

    /**
     * 实收金额
     */
    private Integer receiptAmount;
    private Double receiptAmountVo;

    /**
     * 订单标题
     */
    private String subject;

    /**
     * 交易创建时间
     * 该笔交易创建的时间。格式为yyyy-MM-dd HH:mm:ss
     */
    private Date gmtCreate;
    private String gmtCreateVo;

    /**
     * 交易付款时间
     * 该笔交易的买家付款时间。格式为yyyy-MM-dd HH:mm:ss
     */
    private Date gmtPayment;
    private String gmtPaymentVo;

    /**
     * 创建时间
     */
    private Date createTime;
    private String createTimeVo;

    public void setTotalAmount(Integer totalAmount) {
        this.totalAmountVo = Double.valueOf(totalAmount) / 100;
        this.totalAmount = totalAmount;
    }

    public void setReceiptAmount(Integer receiptAmount) {
        this.receiptAmountVo = Double.valueOf(receiptAmount) / 100;
        this.receiptAmount = receiptAmount;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreateVo = DateUtil.getTime(gmtCreate);
        this.gmtCreate = gmtCreate;
    }

    public void setGmtPayment(Date gmtPayment) {
        this.gmtPaymentVo = DateUtil.getTime(gmtPayment);
        this.gmtPayment = gmtPayment;
    }

    public void setCreateTime(Date createTime) {
        this.createTimeVo = DateUtil.getTime(createTime);
        this.createTime = createTime;
    }
}